package com.lzh.jackson.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * @author zhehen.lu
 * @date 2025/8/13 10:02
 */
public class JacksonNumberPercentSerializer extends JsonSerializer<Number> {
    public JacksonNumberPercentSerializer() {
    }

    @Override
    public void serialize(Number value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeString(value.toString() + "%");
    }
}
